<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>下载APP</title>
    <link rel="stylesheet" type="text/css" href="css/common.css"/>
    <style type="text/css">
    	body{
    		font-family: "微软雅黑";
    	}
    	.box{
    		width: 100%;
    		height: 100%;
    		background: url(img/share_bg.png) no-repeat left top;
    		background-size: 100%;
    	}
    	.person_news{
    		width: 100%;
    		height: 245px;
    		padding-top: 345px;
    		display: flex;
    		flex-direction: column;
    		/*justify-content: center;*/
    		align-items: center;
    	}
    	.pic{
    		width: 114px;
    		height: 114px;
    		border-radius: 50%;
    		overflow: hidden;
    	}
    	.pic img{
    		width: 100%;
    		height: 100%;
    	}
    	.nickname{
    		padding-top: 28px;
    		font-weight: bold;
    		color: #ffd800;
    		font-size: 36px;
    	}
    	.code{
    		color: #ffffff;
    		font-size: 24px;
    		margin-top: 20px;
    	}
    	.register{
    		width: 100%;
    		padding-top: 184px;
    	}
    	.register div{
    		display: flex;
    		justify-content: center;
    	}
    	.register div:nth-of-type(1){
    		height: 130px;
    		line-height: 130px;
    		font-size: 54px;
    		color: #ffea78;
    		font-weight: 600;
    	}
    	.register div:nth-of-type(2){
    		height: 84px;
    		line-height: 84px;
    		font-size: 24px;
    		color: #FFFFFF;
    		margin-bottom: 72px;
    	}
    	.register div:nth-of-type(3){
    		width: 100%;
    		text-align: center;
    	}
    	.register div:nth-of-type(3) input{
    		width: 100%;
    		height: 70px;
    		margin-left: 74px;
    		margin-right: 74px;
    		margin-bottom: 203px;
    		color: #d20023;
    		font-size: 24px;
    		font-weight: border;
    		border-radius: 6px;
    		border: none;
    		background-color: #ffea78;
    	}
    </style>
</head>
<body style="width: 100%;height: 100%;">
	<div class="box">
		<div class="person_news">
			<div class="pic">
				<img id="imgPortrait"/>
			</div>
			<div class="nickname" id="nickname"></div>
			<div class="code">
				<span class="class">邀请码：</span>
				<span class="class" id="codeText"></span>
			</div>
		</div>
		<div class="register">
			<div>
				注册成功
			</div>
			<div>
				您与奖励只差一步距离，赶快下载登录APP吧
			</div>
			<div>
				<input type="button" id="xiazai" value="下载鸿福家园 APP" />
			</div>
		</div>
	</div>
</body>
    <script type="text/javascript" src="js/jquery-2.1.0.js" ></script>
	<script type="text/javascript">
	    function GetQueryString(name)
		{
		     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
		     var r = window.location.search.substr(1).match(reg);
		     if(r!=null)return  unescape(r[2]); return null;
		}
	    var codeText = GetQueryString("codeText");
	    var userId = GetQueryString("userId");
	    $("#codeText").text(codeText);
	    
	    if(userId!=null){
			
	        $.ajax({
						contentType: "application/json",
						type:"GET",
						url:"http://api.hfjycn.com:9080/shop-cloud-api/api/getUserId?userId="+userId,
						async:false,
						success: function (data)
				        {
				     	
				        	$('#nickname').html(data.body.nickname);
				        	
				            if(data.body.portrait){
				            	$("#imgPortrait").attr('src',data.body.portrait);
				            	
				            }else{
				            	$("#imgPortrait").attr('src',"img/header.png");
				            	
				            }	
				        	
				        }
				        
				    });
	
		}

	    	$('#xiazai').on("click",function(){
	    	   //alert("非常抱歉！ 您的应用还未上线， 上线后再申请应用推广链接。");
	    	
	    	  //判断设备
				var u = navigator.userAgent;
				if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手机
				//alert("安卓手机");
				 window.location.href = "https://www.pgyer.com/YYO1";
				} else if (u.indexOf('iPhone') > -1) {//苹果手机
				 window.location.href = "https://www.pgyer.com/WK4W";
				 //alert("苹果手机");
				} else if (u.indexOf('Windows Phone') > -1) {//winphone手机
				//alert("winphone手机");
				 alert("抱歉！没有该适配机安装包！");
				// window.location.href = "mobile/index.html";
				}

	        });
    	function setzoom(psWidth){
			var oWidth=document.documentElement.clientWidth;
			var scale=oWidth/psWidth;
			document.body.style.zoom = scale;
		}
		window.onresize =function(){
			setzoom(750);
		}
		window.onload =function(){
			setzoom(750);
		}
    </script>
</html>